<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>5.关于对象的简写形式</title>
	</head>
	<body>
		<script type="text/javascript" >
			/* let a = 'name'
			let obj = {
				age:18,
				sex:'男'
			}
			obj[a] = '张三'
			console.log(obj) */

			//下面是简写方式
			/* let a = 'hello'
			let obj = {a:a} //  才可以简写为 ：let obj = {a}
			console.log(obj) */

			// let obj = {a:'a'} //这种形式，没有对应的简写形式

			let obj = {a}


		</script>
	</body>
</html>